package cn.gameo2o.service.xmgl.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.gameo2o.dao.xmgl.XiangMuGuanLiDAO;
import cn.gameo2o.pojo.O2o_game;
import cn.gameo2o.service.xmgl.XiangMuGuanLiService;
import cn.gameo2o.util.PageParam;

/**
 * 活动管理service实现
 * @author 孙祺然
 *
 */
@Service
public class XiangMuGuanLiServiceImpl implements XiangMuGuanLiService  {
	
	@Autowired
	private XiangMuGuanLiDAO xmdao;
	public O2o_game findById(Integer id) {
		// TODO Auto-generated method stub
		return xmdao.selectById(id);
	}

	public List<O2o_game> find(Map<String, Object> params, PageParam page) {
		// TODO Auto-generated method stub
		Long count = xmdao.count(params);
        page.setTotal(count);
        page.setRows(xmdao.select(params,page.getFirst(),page.getPageSize()));
        return xmdao.select(params, page.getFirst(), page.getPageSize());
	}

	public int save(O2o_game stu) {
		// TODO Auto-generated method stub
		return xmdao.save(stu);
	}

	public int update(O2o_game stu) {
		// TODO Auto-generated method stub
		return xmdao.update(stu);
	}

	public int delete(Integer id) {
		// TODO Auto-generated method stub
		return xmdao.delete(id);
	}

}
